/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controller;

import Model.Agenda;
import Model.LignePaiement;
import Model.Paiement;

/**
 *
 * @author Hugo
 */
public class PaiementController extends AbstractController{
    
    public static final String LISTE_CHAMBRE_PROPERTY = "ListeChambre";
    
    public static final String TOTAL_PROPERTY = "Total";
    
    public static final String SOUS_TOTAL_PROPERTY = "SousTotal";
    
    public static final String TPS_PROPERTY = "TPS";
    
    public static final String TVQ_PROPERTY = "TVQ";
    
    public static final String PAIEMENT_PROPERTY = "Paiement";
    
    public static final String AJOUTER_PAIEMENT_EVENT = "Le paiement a ete ajoute au grand livre";


    public void updateSousTotal() {
        updateProperty(SOUS_TOTAL_PROPERTY);                                 
    }
    
    
    public void addChambre(int numChambre){
        LignePaiement lignePaiement = Agenda.getInstance().TerminerChambre(numChambre);
        if(lignePaiement != null)
        {
            
            addLineToModelProperty(LISTE_CHAMBRE_PROPERTY, lignePaiement);
        }
    }

    public void updateAll() {
            updateProperty(SOUS_TOTAL_PROPERTY);
            updateProperty(TPS_PROPERTY);
            updateProperty(TVQ_PROPERTY);
            updateProperty(TOTAL_PROPERTY);
    }
    
    public void addPaiement(){
        updateProperty(PAIEMENT_PROPERTY);
    }
}
